<!-- 我的 - 顾问 - 申请成为顾问（这里申请状态用组件区分） -->
<template>
  <view>
    <z-navbar title="申请成为顾问" :border-bottom="true"></z-navbar>
    <template v-if="!state.loading">
      <AdviserAdd v-if="!state.detailData || state.resubmit" :data="state.detailData" />
      <AdviserDetail v-else :data="state.detailData" @reSubmit="state.resubmit = true"/>
    </template>
  </view>
</template>

<script setup>
import AdviserAdd from '@/package_user/components/adviser-add.vue'
import AdviserDetail from '@/package_user/components/adviser-detail.vue'
import { getAdviserDetail } from '@/common/http/module/user'

const state = reactive({
  detailData: '',
  loading: true,
  resubmit: false
})

function loadData() {
  state.loading = true
  getAdviserDetail().then(res => {
    state.detailData = res.data
    state.loading = false
  }).catch(() => {
    state.loading = false
  })
}


onLoad(() => loadData())
</script>

<style lang="scss" scoped>
.option-item {
  display: flex;
  align-items: center;
  color: #333;
  font-size: 28rpx;
  font-family: PingFangSC-Medium;
}

.label-left {
  margin-left: -12rpx;
}

.p-t-6 {
  padding-top: 6rpx;
}
</style>

